/*
 * Copyright (C) 2022 Huawei Technologies Co., Ltd.
 * Licensed under the Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *     http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
 * PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef DRVMGR_DRVCALL_DYN_CONF_MGR_H
#define DRVMGR_DRVCALL_DYN_CONF_MGR_H

#include <stdint.h>
#include <pthread.h>
#include <dlist.h>
#include <tee_defines.h>
#include <tee_driver_module.h>
#include "drv_dispatch.h"
#include "dyn_conf_common.h"

#define DRVCALL_DEC_CNT_INCLUDE_REGISTER_ONE 2U

struct drvcall_conf_t {
    struct tee_uuid uuid;
    struct drvcall_perm_apply_t drvcall_perm_apply;
};

struct fd_node {
    struct dlist_node data_list;
    int64_t fd;
    struct task_node *drv;
    bool close_flag;
};

void dump_all_drvcall_conf(void);

int32_t receive_perm_apply_list(struct drvcall_perm_apply_t *drvcall_perm_apply);

#endif
